Skip to content

fix(server): Antigravity limits prefer the CLI's sign-in over a stale ACP token - #40737

Closed
MohamedSayed0573 wants to merge 1 commit into
pingdotgg:mainfrom
MohamedSayed0573:fix/antigravity-usage-limits-stale-token
Closed

MohamedSayed0573 wants to merge 1 commit into
pingdotgg:mainfrom
MohamedSayed0573:fix/antigravity-usage-limits-stale-token

Conversation

@MohamedSayed0573

Copy link
Copy Markdown
Contributor

Antigravity's usage probe checked acp_token.json before the 1.5.x CLI's own sign-in (antigravity-oauth-token, or the OS keyring for Gemini Enterprise). When a profile still had a leftover acp_token.json from an older integration or a different Google account, the usage panel reported that stale account's quotas instead of the account the agent actually runs with.

Read the CLI's sign-in first (antigravity-oauth-token, or the OS keyring for oauth-business with keyring read errors falling back) and only fall back to acp_token.json when the CLI has no sign-in. Expired CLI tokens report the existing "saved sign-in has expired" message instead of silently falling back to acp_token.json, and cached access is cleared when using the CLI sign-in or when signed out.

Verification:

  • Added coverage in apps/server/src/provider/antigravityUsageLimits.test.ts for preferring the CLI sign-in over a leftover acp_token.json and refusing to fall back when the CLI token has expired.
  • vp run check:changed upstream/main passed (format, lint, knip, graphql, typecheck, tests).

Gemini 4 Neon (Medium) via Antigravity

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for this. #39544 makes the same change and is the one being kept.

#39544 addresses the same account mismatch and also removes the legacy token fallback. That matters when the CLI is signed out: this change can still show the old account's quota, while the other fix reports that sign-in is required.

Your CLI-first approach addresses the valid-sign-in case. Removing the obsolete fallback also covers the missing-sign-in case without retaining the old refresh path and cache.

Closing as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants